home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 April / macformat-023.iso / Shareware City / Comms / tiafaq folder / DialTIA < prev    next >
Encoding:
Text File  |  1994-11-12  |  2.3 KB  |  109 lines  |  [TEXT/EMAC]

  1. ! InterSLIP dial script for Hayes compatible modems and The Internet Adapter
  2.  
  3. ! Original script by Fred Morris
  4. ! Modifications by Adam C. Engst, Paul Ediger
  5. ! Modified for The Internet Adapter (TIA) by Bill Arnett
  6. !   other users may have to modify the lines marked with "<-------- "
  7.  
  8. @originate
  9. ! Initialize modem from string in InterSLIP configuration
  10. note "Initializing modem"
  11. write "^4\13"
  12. pause 10
  13. ! Set speaker mode
  14. write "ATM^2\13"
  15. pause 10
  16. SetTries 0
  17.  
  18. @label 8
  19. ! Dial modem from number and tone/pulse option in InterSLIP configuration
  20. note "Dialing ^1"
  21. write "ATDT^3^1\13"
  22. pause 30                ! just so he can see the phone #
  23.  
  24. ! Check only for BUSY or CONNECT
  25. matchstr 1 10 "BUSY"
  26. matchstr 2 20 "CONNECT"
  27. note "Waiting for CONNECT"
  28. matchread 500
  29.  
  30. @label 10
  31. ! got BUSY or no response
  32. IncTries
  33. IfTries 99 15                ! <-------- try 99 times before asking user
  34.  
  35. ! hang up and reinitialize modem from string in InterSLIP configuration
  36. note "Reinitializing modem"
  37. pause 30
  38. write "+++"
  39. pause 60
  40. write "ATH\13"
  41. pause 30
  42. write "^4\13"
  43. jump 8
  44.  
  45. @label 15
  46. ! ask the user if he wants to continue dialing
  47. ask 0 "enter anything to stop"
  48. SetTries 0
  49. ifstr 1 8 "^*^1"
  50.  
  51. ! he wants to stop
  52. SetTries 123        ! indicate that dialing failed
  53. exit -1
  54.  
  55. @label 20
  56. ! got CONNECT, indicate success and proceed to the Gateway script
  57. exit 0
  58.  
  59.  
  60. @hangup
  61. pause 10
  62. IfTries 123 99
  63. pause 10
  64. IfTries 124 50
  65.  
  66. pause 1
  67. note "Terminating TIA"
  68. write "\03\03\03"            ! <-------- intr character
  69. pause 21
  70. write "\03\03"                ! <-------- intr character
  71. matchclr
  72. SetTries 124        ! indicate that we've killed it
  73. note "Waiting for TIA to die"
  74.  
  75. ! if we ran TIA under the shell then we should get another shell prompt;
  76. ! if we exec'ed it then the modem should hang up
  77. matchstr 1 30 "% "            ! <-------- shell prompt
  78. matchstr 2 98 "NO CARRIER"
  79. matchread 400
  80. ! if we fail to kill TIA, just drop the line anyway
  81. jump 50
  82.  
  83. @label 30
  84. ! issue logout command to logout normally
  85. note "Logging out"
  86. write "logout\13"            ! <-------- logout command
  87. matchclr
  88. ! the modem should notice that the host dropped the line
  89. matchstr 1 98 "NO CARRIER"
  90. matchread 400
  91. ! if the host doesn't drop the line, we hang up locally
  92.  
  93. @label 50
  94. ! Hang up the modem
  95. note "Hanging up modem"
  96. write "+++"
  97. pause 60
  98. write "ATH\13"
  99.  
  100. @label 98
  101. ! Reinitialize the modem from string in InterSLIP configuration
  102. write "^4\13"
  103.  
  104. @label 99
  105. ! we're outta here!
  106. note "Off"
  107. SetTries 0
  108. exit 0
  109.